﻿@model dynamic

@{
    ViewBag.Title = "Create a new tag.";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Create Tag</h2>

@Html.DropDownList("Name", new SelectList(new[] { new{ Name = "Select One" }, new { Name = "Normal" }, new { Name = "Code" }}, "Name", "Name", ViewBag.TagType), new { id = "tagType" })

<div id="createTagView"></div>

@section Scripts{
    <script type="text/javascript">
        $(document).ready(function() {
            $("#tagType").change(function() {
                var type = $(this).val();
                if (type == "Normal") {
                    $("#createTagView")
                        .html("Loading...")
                        .load("Create?tagType=Normal&partial=true");
                } if (type == "Code") {
                    $("#createTagView")
                        .html("Loading...")
                        .load("Create?tagType=Code&partial=true");
                } else {
                    $("#createTagView")
                        .html("");}
                });
                });
    </script>
}
